home *** CD-ROM | disk | FTP | other *** search
/ Underground / Underground CD1.iso / virii / zrodla / a / anti-mon.asm / text0000.txt < prev   
Encoding:
Text File  |  1998-01-14  |  4.1 KB  |  103 lines

  1.  
  2. ;***********************************************************************
  3. ***********************
  4. ;*                                                                      
  5.                       *
  6. ;*      FILE:     ANTI-MON.ASM (c) 1993                                 
  7.                       *
  8. ;*      PURPOSE:  Detect and remove a TSR anti-viral monitor            
  9.                       *
  10. ;*      AUTHOR:   Willoughby    DATE: 05/09/93                          
  11.                       *
  12. ;*                                                                      
  13.                       *
  14. ;***********************************************************************
  15. ***********************
  16.  
  17. MAIN    SEGMENT BYTE
  18.         ASSUME  CS:MAIN,DS:MAIN,ES:MAIN
  19.  
  20.         ORG     100H
  21.  
  22. ;***********************************************************************
  23. ***********************
  24. ;The purpose of this routine is simply to demonstrate the function of 
  25. the FIND_AV_MON and 
  26. ;NEUT_AV_MON routines.  It displays a message based upon the results of 
  27. the test for TSR anti-
  28. ;viral monitor interrupt vectors performed by the FIND_AV_MON routine 
  29. and the action taken, if 
  30. ;needed, by the NEUT_AV_MON routine.  
  31.  
  32. START:  call    FIND_AV_MON                     ;check for installed 
  33. anti-viral monitors
  34.         jc      MP1                             ;if carry is set, a 
  35. monitor is present 
  36.         mov     dx,OFFSET NOT_HERE_MSG          ;if not, display 
  37. appropriate message
  38.         jmp     MPEX                            ;during exit
  39. MP1:    cmp     WORD PTR [MONITOR_TYPE],0       ;check for type/version 
  40. of monitor present
  41.         mov     dx,OFFSET MON0_HERE_MSG 
  42.         je      MP2                             ;if MONITOR_TYPE = 0, 
  43. display v1.0 message
  44.         mov     dx,OFFSET MON1_HERE_MSG         ;otherwise, display v6.0 
  45. message
  46. MP2:    mov     ah,9
  47.         int     21H
  48.         call    NEUT_AV_MON                     ;then restore vectors to 
  49. original values 
  50.         mov     dx,OFFSET BUT_NOW_MSG           ;display monitor removal 
  51. message
  52. MPEX:   mov     ah,9
  53.         int     21H
  54.         mov     ax,4C00H                        ;exit program
  55.         int     21H
  56.  
  57. NOT_HERE_MSG:   
  58.         DB      0DH,0AH,'VSAFE is not present.',0DH,0AH,24H
  59. MON0_HERE_MSG:
  60.         DB      0DH,0AH,7,'VSAFE v1.0 is present.',0DH,0AH,24H
  61. MON1_HERE_MSG:
  62.         DB      0DH,0AH,7,'MS-DOS 6.0 VSAFE is present',0DH,0AH,24H
  63. BUT_NOW_MSG:
  64.         DB      0DH,0AH,'But now, it just APPEARS to be.',0DH,0AH,24H
  65.  
  66.  
  67. ;***********************************************************************
  68. ***********************
  69. ;This routine tests for the presence in memory of two versions of VSAFE 
  70. by comparing the 
  71. ;offsets of the interrupt vectors stolen during VSAFE's installation 
  72. with known VSAFE interrupt 
  73. ;handler offsets.  When it finds any three offset values in the system 
  74. interrupt vector table 
  75. ;which match the VSAFE offsets for the corresponding interrupt, the 
  76. carry flag is set to 
  77. ;indicate the presence of VSAFE in memory to the calling routine.  The 
  78. segment in which VSAFE 
  79. ;resides is stored in MONITOR_SEGMENT and the VSAFE version stored in 
  80. MONITOR_TYPE for use by 
  81. ;the NEUT_AV_MON routine. 
  82.  
  83. NUM_MONITORS    EQU     2                       ;# of anti-viral monitor 
  84. types to check for
  85. NUM_VECTORS     EQU     8                       ;# of interrupt vector 
  86. table entries to check
  87. MATCHES_REQ     EQU     3                       ;# of offset matches 
  88. required for positive ID
  89.  
  90. FIND_AV_MON:
  91.         push    es
  92.         xor     ax,ax
  93.         mov     es,ax                           ;set ES to segment of 
  94. interrupt vector table
  95.         mov     cx,NUM_VECTORS                  ;set loop counter to # 
  96. of vectors to check 
  97.         mov     si,OFFSET VECTOR_OFFSETS        ;point SI to start of 
  98. vector offset string
  99. FAMLP1: lodsw                                   ;load vector table 
  100. offset of first vector
  101.         mov     bx,ax
  102.         mov     dx,w[es:bx]                     ;load offset of vector 
  103.